home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WFC010.ZIP / SRC / LMERR.CPP < prev    next >
C/C++ Source or Header  |  1995-12-07  |  39KB  |  1,434 lines

  1. #include <wfc.h>
  2. #pragma hdrstop
  3.  
  4. /*
  5. ** Author: Samuel R. Blackburn
  6. ** CI$: 76300,326
  7. ** Internet: sammy@sed.csc.com
  8. **
  9. ** You can use it any way you like as long as you don't try to sell it.
  10. **
  11. ** Any attempt to sell WFC in source code form must have the permission
  12. ** of the original author. You can produce commercial executables with
  13. ** WFC but you can't sell WFC.
  14. **
  15. ** Copyright, 1995, Samuel R. Blackburn
  16. **
  17. ** $Workfile: $
  18. ** $Revision: $
  19. ** $Modtime: $
  20. */
  21.  
  22. #if defined( _DEBUG )
  23. #undef THIS_FILE
  24. static char BASED_CODE THIS_FILE[] = __FILE__;
  25. #define new DEBUG_NEW
  26. #endif
  27.  
  28. void Convert_NERR_Code_to_String( DWORD error_code, CString& error_message )
  29. {
  30.    switch( error_code )
  31.    {
  32.       case NERR_Success:
  33.  
  34.          error_message = "Success.";
  35.          return;
  36.  
  37.       case NERR_NetNotStarted:
  38.    
  39.          error_message = "The workstation driver is not installed.";
  40.          return;
  41.  
  42.       case NERR_UnknownServer:
  43.    
  44.          error_message = "The server could not be located.";
  45.          return;
  46.  
  47.       case NERR_ShareMem:
  48.    
  49.          error_message = "An internal error occurred. The network cannot access a shared memory segment.";
  50.          return;
  51.  
  52.       case NERR_NoNetworkResource:
  53.    
  54.          error_message = "A network resource shortage occurred.";
  55.          return;
  56.  
  57.       case NERR_RemoteOnly:
  58.    
  59.          error_message = "This operation is not supported on workstations.";
  60.          return;
  61.  
  62.       case NERR_DevNotRedirected:
  63.    
  64.          error_message = "The device is not connected.";
  65.          return;
  66.  
  67.       case NERR_ServerNotStarted:
  68.    
  69.          error_message = "The Server service is not started.";
  70.          return;
  71.  
  72.       case NERR_ItemNotFound:
  73.    
  74.          error_message = "The queue is empty.";
  75.          return;
  76.  
  77.       case NERR_UnknownDevDir:
  78.    
  79.          error_message = "The device or directory does not exist.";
  80.          return;
  81.  
  82.       case NERR_RedirectedPath:
  83.    
  84.          error_message = "The operation is invalid on a redirected resource.";
  85.          return;
  86.  
  87.       case NERR_DuplicateShare:
  88.    
  89.          error_message = "The name has already been shared.";
  90.          return;
  91.  
  92.       case NERR_NoRoom:
  93.    
  94.          error_message = "The server is currently out of the requested resource.";
  95.          return;
  96.  
  97.       case NERR_TooManyItems:
  98.    
  99.          error_message = "Requested addition of items exceeds the maximum allowed.";
  100.          return;
  101.  
  102.       case NERR_InvalidMaxUsers:
  103.    
  104.          error_message = "The Peer service supports only two simultaneous users.";
  105.          return;
  106.  
  107.       case NERR_BufTooSmall:
  108.    
  109.          error_message = "The API return buffer is too small.";
  110.          return;
  111.  
  112.       case NERR_RemoteErr:
  113.    
  114.          error_message = "A remote API error occurred.";
  115.          return;
  116.  
  117.       case NERR_LanmanIniError:
  118.    
  119.          error_message = "An error occurred when opening or reading the configuration file.";
  120.          return;
  121.  
  122.       case NERR_NetworkError:
  123.    
  124.          error_message = "A general network error occurred.";
  125.          return;
  126.  
  127.       case NERR_WkstaInconsistentState:
  128.    
  129.          error_message = "The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service.";
  130.          return;
  131.  
  132.       case NERR_WkstaNotStarted:
  133.    
  134.          error_message = "The Workstation service has not been started.";
  135.          return;
  136.  
  137.       case NERR_BrowserNotStarted:
  138.    
  139.          error_message = "The requested information is not available.";
  140.          return;
  141.  
  142.       case NERR_InternalError:
  143.    
  144.          error_message = "An internal Windows NT error occurred.";
  145.          return;
  146.  
  147.       case NERR_BadTransactConfig:
  148.    
  149.          error_message = "The server is not configured for transactions.";
  150.          return;
  151.  
  152.       case NERR_InvalidAPI:
  153.    
  154.          error_message = "The requested API is not supported on the remote server.";
  155.          return;
  156.  
  157.       case NERR_BadEventName:
  158.    
  159.          error_message = "The event name is invalid.";
  160.          return;
  161.  
  162.       case NERR_DupNameReboot:
  163.    
  164.          error_message = "The computer name already exists on the network. Change it and restart the computer.";
  165.          return;
  166.  
  167.       case NERR_CfgCompNotFound:
  168.    
  169.          error_message = "The specified component could not be found in the configuration information.";
  170.          return;
  171.  
  172.       case NERR_CfgParamNotFound:
  173.    
  174.          error_message = "The specified parameter could not be found in the configuration information.";
  175.          return;
  176.  
  177.       case NERR_LineTooLong:
  178.    
  179.          error_message = "A line in the configuration file is too long.";
  180.          return;
  181.  
  182.       case NERR_QNotFound:
  183.    
  184.          error_message = "The printer does not exist.";
  185.          return;
  186.  
  187.       case NERR_JobNotFound:
  188.    
  189.          error_message = "The print job does not exist.";
  190.          return;
  191.  
  192.       case NERR_DestNotFound:
  193.    
  194.          error_message = "The printer destination cannot be found.";
  195.          return;
  196.  
  197.       case NERR_DestExists:
  198.    
  199.          error_message = "The printer destination already exists.";
  200.          return;
  201.  
  202.       case NERR_QExists:
  203.    
  204.          error_message = "The printer queue already exists.";
  205.          return;
  206.  
  207.       case NERR_QNoRoom:
  208.    
  209.          error_message = "No more printers can be added.";
  210.          return;
  211.  
  212.       case NERR_JobNoRoom:
  213.    
  214.          error_message = "No more print jobs can be added.";
  215.          return;
  216.  
  217.       case NERR_DestNoRoom:
  218.    
  219.          error_message = "No more printer destinations can be added.";
  220.          return;
  221.  
  222.       case NERR_DestIdle:
  223.    
  224.          error_message = "This printer destination is idle and cannot accept control operations.";
  225.          return;
  226.  
  227.       case NERR_DestInvalidOp:
  228.    
  229.          error_message = "This printer destination request contains an invalid control function.";
  230.          return;
  231.  
  232.       case NERR_ProcNoRespond:
  233.    
  234.          error_message = "The print processor is not responding.";
  235.          return;
  236.  
  237.       case NERR_SpoolerNotLoaded:
  238.    
  239.          error_message = "The spooler is not running.";
  240.          return;
  241.  
  242.       case NERR_DestInvalidState:
  243.    
  244.          error_message = "This operation cannot be performed on the print destination in its current state.";
  245.          return;
  246.  
  247.       case NERR_QInvalidState:
  248.    
  249.          error_message = "This operation cannot be performed on the printer queue in its current state.";
  250.          return;
  251.  
  252.       case NERR_JobInvalidState:
  253.    
  254.          error_message = "This operation cannot be performed on the print job in its current state.";
  255.          return;
  256.  
  257.       case NERR_SpoolNoMemory:
  258.    
  259.          error_message = "A spooler memory allocation failure occurred.";
  260.          return;
  261.  
  262.       case NERR_DriverNotFound:
  263.    
  264.          error_message = "The device driver does not exist.";
  265.          return;
  266.  
  267.       case NERR_DataTypeInvalid:
  268.    
  269.          error_message = "The data type is not supported by the print processor.";
  270.          return;
  271.  
  272.       case NERR_ProcNotFound:
  273.    
  274.          error_message = "The print processor is not installed.";
  275.          return;
  276.  
  277.       case NERR_ServiceTableLocked:
  278.    
  279.          error_message = "The service database is locked.";
  280.          return;
  281.  
  282.       case NERR_ServiceTableFull:
  283.    
  284.          error_message = "The service table is full.";
  285.          return;
  286.  
  287.       case NERR_ServiceInstalled:
  288.    
  289.          error_message = "The requested service has already been started.";
  290.          return;
  291.  
  292.       case NERR_ServiceEntryLocked:
  293.    
  294.          error_message = "The service does not respond to control actions.";
  295.          return;
  296.  
  297.       case NERR_ServiceNotInstalled:
  298.    
  299.          error_message = "The service has not been started.";
  300.          return;
  301.  
  302.       case NERR_BadServiceName:
  303.    
  304.          error_message = "The service name is invalid.";
  305.          return;
  306.  
  307.       case NERR_ServiceCtlTimeout:
  308.    
  309.          error_message = "The service is not responding to the control function.";
  310.          return;
  311.  
  312.       case NERR_ServiceCtlBusy:
  313.    
  314.          error_message = "The service control is busy.";
  315.          return;
  316.  
  317.       case NERR_BadServiceProgName:
  318.    
  319.          error_message = "The configuration file contains an invalid service program name.";
  320.          return;
  321.  
  322.       case NERR_ServiceNotCtrl:
  323.    
  324.          error_message = "The service could not be controlled in its present state.";
  325.          return;
  326.  
  327.       case NERR_ServiceKillProc:
  328.    
  329.          error_message = "The service ended abnormally.";
  330.          return;
  331.  
  332.       case NERR_ServiceCtlNotValid:
  333.    
  334.          error_message = "The requested pause or stop is not valid for this service.";
  335.          return;
  336.  
  337.       case NERR_NotInDispatchTbl:
  338.    
  339.          error_message = "The service control dispatcher could not find the service name in the dispatch table.";
  340.          return;
  341.  
  342.       case NERR_BadControlRecv:
  343.    
  344.          error_message = "The service control dispatcher pipe read failed.";
  345.          return;
  346.  
  347.       case NERR_ServiceNotStarting:
  348.    
  349.          error_message = "A thread for the new service could not be created.";
  350.          return;
  351.  
  352.       case NERR_AlreadyLoggedOn:
  353.    
  354.          error_message = "This workstation is already logged on to the local-area network.";
  355.          return;
  356.  
  357.       case NERR_NotLoggedOn:
  358.    
  359.          error_message = "The workstation is not logged on to the local-area network.";
  360.          return;
  361.  
  362.       case NERR_BadUsername:
  363.    
  364.          error_message = "The user name or group name parameter is invalid.";
  365.          return;
  366.  
  367.       case NERR_BadPassword:
  368.    
  369.          error_message = "The password parameter is invalid.";
  370.          return;
  371.  
  372.       case NERR_UnableToAddName_W:
  373.    
  374.          error_message = "@W The logon processor did not add the message alias.";
  375.          return;
  376.  
  377.       case NERR_UnableToAddName_F:
  378.    
  379.          error_message = "The logon processor did not add the message alias.";
  380.          return;
  381.  
  382.       case NERR_UnableToDelName_W:
  383.    
  384.          error_message = "@W The logoff processor did not delete the message alias.";
  385.          return;
  386.  
  387.       case NERR_UnableToDelName_F:
  388.    
  389.          error_message = "The logoff processor did not delete the message alias.";
  390.          return;
  391.  
  392.       case NERR_LogonsPaused:
  393.    
  394.          error_message = "Network logons are paused.";
  395.          return;
  396.  
  397.       case NERR_LogonServerConflict:
  398.    
  399.          error_message = "A centralized logon-server conflict occurred.";
  400.          return;
  401.  
  402.       case NERR_LogonNoUserPath:
  403.    
  404.          error_message = "The server is configured without a valid user path.";
  405.          return;
  406.  
  407.       case NERR_LogonScriptError:
  408.    
  409.          error_message = "An error occurred while loading or running the logon script.";
  410.          return;
  411.  
  412.       case NERR_StandaloneLogon:
  413.    
  414.          error_message = "The logon server was not specified. Your computer will be logged on as STANDALONE.";
  415.          return;
  416.  
  417.       case NERR_LogonServerNotFound:
  418.    
  419.          error_message = "The logon server could not be found.";
  420.          return;
  421.  
  422.       case NERR_LogonDomainExists:
  423.    
  424.          error_message = "There is already a logon domain for this computer.";
  425.          return;
  426.  
  427.       case NERR_NonValidatedLogon:
  428.    
  429.          error_message = "The logon server could not validate the logon.";
  430.          return;
  431.  
  432.       case NERR_ACFNotFound:
  433.    
  434.          error_message = "The security database could not be found.";
  435.          return;
  436.  
  437.       case NERR_GroupNotFound:
  438.    
  439.          error_message = "The group name could not be found.";
  440.          return;
  441.  
  442.       case NERR_UserNotFound:
  443.    
  444.          error_message = "The user name could not be found.";
  445.          return;
  446.  
  447.       case NERR_ResourceNotFound:
  448.    
  449.          error_message = "The resource name could not be found.";
  450.          return;
  451.  
  452.       case NERR_GroupExists:
  453.    
  454.          error_message = "The group already exists.";
  455.          return;
  456.  
  457.       case NERR_UserExists:
  458.    
  459.          error_message = "The user account already exists.";
  460.          return;
  461.  
  462.       case NERR_ResourceExists:
  463.    
  464.          error_message = "The resource permission list already exists.";
  465.          return;
  466.  
  467.       case NERR_NotPrimary:
  468.    
  469.          error_message = "This operation is only allowed on the primary domain controller of the domain.";
  470.          return;
  471.  
  472.       case NERR_ACFNotLoaded:
  473.    
  474.          error_message = "The security database has not been started.";
  475.          return;
  476.  
  477.       case NERR_ACFNoRoom:
  478.    
  479.          error_message = "There are too many names in the user accounts database.";
  480.          return;
  481.  
  482.       case NERR_ACFFileIOFail:
  483.    
  484.          error_message = "A disk I/O failure occurred.";
  485.          return;
  486.  
  487.       case NERR_ACFTooManyLists:
  488.    
  489.          error_message = "The limit of 64 entries per resource was exceeded.";
  490.          return;
  491.  
  492.       case NERR_UserLogon:
  493.    
  494.          error_message = "Deleting a user with a session is not allowed.";
  495.          return;
  496.  
  497.       case NERR_ACFNoParent:
  498.    
  499.          error_message = "The parent directory could not be located.";
  500.          return;
  501.  
  502.       case NERR_CanNotGrowSegment:
  503.    
  504.          error_message = "Unable to add to the security database session cache segment.";
  505.          return;
  506.  
  507.       case NERR_SpeGroupOp:
  508.    
  509.          error_message = "This operation is not allowed on this special group.";
  510.          return;
  511.  
  512.       case NERR_NotInCache:
  513.    
  514.          error_message = "This user is not cached in user accounts database session cache.";
  515.          return;
  516.  
  517.       case NERR_UserInGroup:
  518.    
  519.          error_message = "The user already belongs to this group.";
  520.          return;
  521.  
  522.       case NERR_UserNotInGroup:
  523.    
  524.          error_message = "The user does not belong to this group.";
  525.          return;
  526.  
  527.       case NERR_AccountUndefined:
  528.    
  529.          error_message = "This user account is undefined.";
  530.          return;
  531.  
  532.       case NERR_AccountExpired:
  533.    
  534.          error_message = "This user account has expired.";
  535.          return;
  536.  
  537.       case NERR_InvalidWorkstation:
  538.    
  539.          error_message = "The user is not allowed to log on from this workstation.";
  540.          return;
  541.  
  542.       case NERR_InvalidLogonHours:
  543.    
  544.          error_message = "The user is not allowed to log on at this time.";
  545.          return;
  546.  
  547.       case NERR_PasswordExpired:
  548.    
  549.          error_message = "The password of this user has expired.";
  550.          return;
  551.  
  552.       case NERR_PasswordCantChange:
  553.    
  554.          error_message = "The password of this user cannot change.";
  555.          return;
  556.  
  557.       case NERR_PasswordHistConflict:
  558.    
  559.          error_message = "This password cannot be used now.";
  560.          return;
  561.  
  562.       case NERR_PasswordTooShort:
  563.    
  564.          error_message = "The password is shorter than required.";
  565.          return;
  566.  
  567.       case NERR_PasswordTooRecent:
  568.    
  569.          error_message = "The password of this user is too recent to change.";
  570.          return;
  571.  
  572.       case NERR_InvalidDatabase:
  573.    
  574.          error_message = "The security database is corrupted.";
  575.          return;
  576.  
  577.       case NERR_DatabaseUpToDate:
  578.    
  579.          error_message = "No updates are necessary to this replicant network/local security database.";
  580.          return;
  581.  
  582.       case NERR_SyncRequired:
  583.    
  584.          error_message = "This replicant database is outdated; synchronization is required.";
  585.          return;
  586.  
  587.       case NERR_UseNotFound:
  588.    
  589.          error_message = "The network connection could not be found.";
  590.          return;
  591.  
  592.       case NERR_BadAsgType:
  593.    
  594.          error_message = "This asg_type is invalid.";
  595.          return;
  596.  
  597.       case NERR_DeviceIsShared:
  598.    
  599.          error_message = "This device is currently being shared.";
  600.          return;
  601.  
  602.       case NERR_NoComputerName:
  603.    
  604.          error_message = "The computer name could not be added as a message alias. The name may already exist on the network.";
  605.          return;
  606.  
  607.       case NERR_MsgAlreadyStarted:
  608.    
  609.          error_message = "The Messenger service is already started.";
  610.          return;
  611.  
  612.       case NERR_MsgInitFailed:
  613.    
  614.          error_message = "The Messenger service failed to start.";
  615.          return;
  616.  
  617.       case NERR_NameNotFound:
  618.    
  619.          error_message = "The message alias could not be found on the network.";
  620.          return;
  621.  
  622.       case NERR_AlreadyForwarded:
  623.    
  624.          error_message = "This message alias has already been forwarded.";
  625.          return;
  626.  
  627.       case NERR_AddForwarded:
  628.    
  629.          error_message = "This message alias has been added but is still forwarded.";
  630.          return;
  631.  
  632.       case NERR_AlreadyExists:
  633.    
  634.          error_message = "This message alias already exists locally.";
  635.          return;
  636.  
  637.       case NERR_TooManyNames:
  638.    
  639.          error_message = "The maximum number of added message aliases has been exceeded.";
  640.          return;
  641.  
  642.       case NERR_DelComputerName:
  643.    
  644.          error_message = "The computer name could not be deleted.";
  645.          return;
  646.  
  647.       case NERR_LocalForward:
  648.    
  649.          error_message = "Messages cannot be forwarded back to the same workstation.";
  650.          return;
  651.  
  652.       case NERR_GrpMsgProcessor:
  653.    
  654.          error_message = "An error occurred in the domain message processor.";
  655.          return;
  656.  
  657.       case NERR_PausedRemote:
  658.    
  659.          error_message = "The message was sent, but the recipient has paused the Messenger service.";
  660.          return;
  661.  
  662.       case NERR_BadReceive:
  663.    
  664.          error_message = "The message was sent but not received.";
  665.          return;
  666.  
  667.       case NERR_NameInUse:
  668.    
  669.          error_message = "The message alias is currently in use. Try again later.";
  670.          return;
  671.  
  672.       case NERR_MsgNotStarted:
  673.    
  674.          error_message = "The Messenger service has not been started.";
  675.          return;
  676.  
  677.       case NERR_NotLocalName:
  678.    
  679.          error_message = "The name is not on the local computer.";
  680.          return;
  681.  
  682.       case NERR_NoForwardName:
  683.    
  684.          error_message = "The forwarded message alias could not be found on the network.";
  685.          return;
  686.  
  687.       case NERR_RemoteFull:
  688.    
  689.          error_message = "The message alias table on the remote station is full.";
  690.          return;
  691.  
  692.       case NERR_NameNotForwarded:
  693.    
  694.          error_message = "Messages for this alias are not currently being forwarded.";
  695.          return;
  696.  
  697.       case NERR_TruncatedBroadcast:
  698.    
  699.          error_message = "The broadcast message was truncated.";
  700.          return;
  701.  
  702.       case NERR_InvalidDevice:
  703.    
  704.          error_message = "This is an invalid device name.";
  705.          return;
  706.  
  707.       case NERR_WriteFault:
  708.    
  709.          error_message = "A write fault occurred.";
  710.          return;
  711.  
  712.       case NERR_DuplicateName:
  713.    
  714.          error_message = "A duplicate message alias exists on the network.";
  715.          return;
  716.  
  717.       case NERR_DeleteLater:
  718.    
  719.          error_message = "@W This message alias will be deleted later.";
  720.          return;
  721.  
  722.       case NERR_IncompleteDel:
  723.    
  724.          error_message = "The message alias was not successfully deleted from all networks.";
  725.          return;
  726.  
  727.       case NERR_MultipleNets:
  728.    
  729.          error_message = "This operation is not supported on computers with multiple networks.";
  730.          return;
  731.  
  732.       case NERR_NetNameNotFound:
  733.    
  734.          error_message = "This shared resource does not exist.";
  735.          return;
  736.  
  737.       case NERR_DeviceNotShared:
  738.    
  739.          error_message = "This device is not shared.";
  740.          return;
  741.  
  742.       case NERR_ClientNameNotFound:
  743.    
  744.          error_message = "A session does not exist with that computer name.";
  745.          return;
  746.  
  747.       case NERR_FileIdNotFound:
  748.    
  749.          error_message = "There is not an open file with that identification number.";
  750.          return;
  751.  
  752.       case NERR_ExecFailure:
  753.    
  754.          error_message = "A failure occurred when executing a remote administration command.";
  755.          return;
  756.  
  757.       case NERR_TmpFile:
  758.    
  759.          error_message = "A failure occurred when opening a remote temporary file.";
  760.          return;
  761.  
  762.       case NERR_TooMuchData:
  763.    
  764.          error_message = "The data    returned from a remote administration command has been truncated to 64K.";
  765.          return;
  766.  
  767.       case NERR_DeviceShareConflict:
  768.    
  769.          error_message = "This device cannot be shared as both a spooled and a non-spooled resource.";
  770.          return;
  771.  
  772.       case NERR_BrowserTableIncomplete:
  773.    
  774.          error_message = "The information in the list of servers may be incorrect.";
  775.          return;
  776.  
  777.       case NERR_NotLocalDomain:
  778.    
  779.          error_message = "The computer is not active in this domain.";
  780.          return;
  781.  
  782.       case NERR_DevInvalidOpCode:
  783.    
  784.          error_message = "The operation is invalid for this device.";
  785.          return;
  786.  
  787.       case NERR_DevNotFound:
  788.    
  789.          error_message = "This device cannot be shared.";
  790.          return;
  791.  
  792.       case NERR_DevNotOpen:
  793.    
  794.          error_message = "This device was not open.";
  795.          return;
  796.  
  797.       case NERR_BadQueueDevString:
  798.    
  799.          error_message = "This device name list is invalid.";
  800.          return;
  801.  
  802.       case NERR_BadQueuePriority:
  803.    
  804.          error_message = "The queue priority is invalid.";
  805.          return;
  806.  
  807.       case NERR_NoCommDevs:
  808.    
  809.          error_message = "There are no shared communication devices.";
  810.          return;
  811.  
  812.       case NERR_QueueNotFound:
  813.    
  814.          error_message = "The queue you specified does not exist.";
  815.          return;
  816.  
  817.       case NERR_BadDevString:
  818.    
  819.          error_message = "This list of devices is invalid.";
  820.          return;
  821.  
  822.       case NERR_BadDev:
  823.    
  824.          error_message = "The requested device is invalid.";
  825.          return;
  826.  
  827.       case NERR_InUseBySpooler:
  828.    
  829.          error_message = "This device is already in use by the spooler.";
  830.          return;
  831.  
  832.       case NERR_CommDevInUse:
  833.    
  834.          error_message = "This device is already in use as a communication device.";
  835.          return;
  836.  
  837.       case NERR_InvalidComputer:
  838.    
  839.          error_message = "This computer name is invalid.";
  840.          return;
  841.  
  842.       case NERR_MaxLenExceeded:
  843.    
  844.          error_message = "The string and prefix specified are too long.";
  845.          return;
  846.  
  847.       case NERR_BadComponent:
  848.    
  849.          error_message = "This path component is invalid.";
  850.          return;
  851.  
  852.       case NERR_CantType:
  853.    
  854.          error_message = "Could not determine the type of input.";
  855.          return;
  856.  
  857.       case NERR_TooManyEntries:
  858.    
  859.          error_message = "The buffer for types is not big enough.";
  860.          return;
  861.  
  862.       case NERR_ProfileFileTooBig:
  863.    
  864.          error_message = "Profile files cannot exceed 64K.";
  865.          return;
  866.  
  867.       case NERR_ProfileOffset:
  868.    
  869.          error_message = "The start offset is out of range.";
  870.          return;
  871.  
  872.       case NERR_ProfileCleanup:
  873.    
  874.          error_message = "The system cannot delete current connections to network resources.";
  875.          return;
  876.  
  877.       case NERR_ProfileUnknownCmd:
  878.    
  879.          error_message = "The system was unable to parse the command line in this file.";
  880.          return;
  881.  
  882.       case NERR_ProfileLoadErr:
  883.    
  884.          error_message = "An error occurred while loading the profile file.";
  885.          return;
  886.  
  887.       case NERR_ProfileSaveErr:
  888.    
  889.          error_message = "@W Errors occurred while saving the profile file. The profile was partially saved.";
  890.          return;
  891.  
  892.       case NERR_LogOverflow:
  893.    
  894.          error_message = "Log file %1 is full.";
  895.          return;
  896.  
  897.       case NERR_LogFileChanged:
  898.    
  899.          error_message = "This log file has changed between reads.";
  900.          return;
  901.  
  902.       case NERR_LogFileCorrupt:
  903.    
  904.          error_message = "Log file %1 is corrupt.";
  905.          return;
  906.  
  907.       case NERR_SourceIsDir:
  908.    
  909.          error_message = "The source path cannot be a directory.";
  910.          return;
  911.  
  912.       case NERR_BadSource:
  913.    
  914.          error_message = "The source path is illegal.";
  915.          return;
  916.  
  917.       case NERR_BadDest:
  918.    
  919.          error_message = "The destination path is illegal.";
  920.          return;
  921.  
  922.       case NERR_DifferentServers:
  923.    
  924.          error_message = "The source and destination paths are on different servers.";
  925.          return;
  926.  
  927.       case NERR_RunSrvPaused:
  928.    
  929.          error_message = "The Run server you requested is paused.";
  930.          return;
  931.  
  932.       case NERR_ErrCommRunSrv:
  933.    
  934.          error_message = "An error occurred when communicating with a Run server.";
  935.          return;
  936.  
  937.       case NERR_ErrorExecingGhost:
  938.    
  939.          error_message = "An error occurred when starting a background process.";
  940.          return;
  941.  
  942.       case NERR_ShareNotFound:
  943.    
  944.          error_message = "The shared resource you are connected to could not be found.";
  945.          return;
  946.  
  947.       case NERR_InvalidLana:
  948.    
  949.          error_message = "The LAN adapter number is invalid.";
  950.          return;
  951.  
  952.       case NERR_OpenFiles:
  953.    
  954.          error_message = "There are open files on the connection.";
  955.          return;
  956.  
  957.       case NERR_ActiveConns:
  958.    
  959.          error_message = "Active connections still exist.";
  960.          return;
  961.  
  962.       case NERR_BadPasswordCore:
  963.    
  964.          error_message = "This share name or password is invalid.";
  965.          return;
  966.  
  967.       case NERR_DevInUse:
  968.    
  969.          error_message = "The device is being accessed by an active process.";
  970.          return;
  971.  
  972.       case NERR_LocalDrive:
  973.    
  974.          error_message = "The drive letter is in use locally.";
  975.          return;
  976.  
  977.       case NERR_AlertExists:
  978.    
  979.          error_message = "The specified client is already registered for the specified event.";
  980.          return;
  981.  
  982.       case NERR_TooManyAlerts:
  983.    
  984.          error_message = "The alert table is full.";
  985.          return;
  986.  
  987.       case NERR_NoSuchAlert:
  988.    
  989.          error_message = "An invalid or nonexistent alert name was raised.";
  990.          return;
  991.  
  992.       case NERR_BadRecipient:
  993.    
  994.          error_message = "The alert recipient is invalid.";
  995.          return;
  996.  
  997.       case NERR_AcctLimitExceeded:
  998.    
  999.          error_message = "A user's session with this server has been deleted because the user's logon hours are no longer valid.";
  1000.          return;
  1001.  
  1002.       case NERR_InvalidLogSeek:
  1003.    
  1004.          error_message = "The log file does not contain the requested record number.";
  1005.          return;
  1006.  
  1007.       case NERR_BadUasConfig:
  1008.    
  1009.          error_message = "The user accounts database is not configured correctly.";
  1010.          return;
  1011.  
  1012.       case NERR_InvalidUASOp:
  1013.    
  1014.          error_message = "This operation is not permitted when the Netlogon service is running.";
  1015.          return;
  1016.  
  1017.       case NERR_LastAdmin:
  1018.    
  1019.          error_message = "This operation is not allowed on the last administrative account.";
  1020.          return;
  1021.  
  1022.       case NERR_DCNotFound:
  1023.    
  1024.          error_message = "Could not find domain controller for this domain.";
  1025.          return;
  1026.  
  1027.       case NERR_LogonTrackingError:
  1028.    
  1029.          error_message = "Could not set logon information for this user.";
  1030.          return;
  1031.  
  1032.       case NERR_NetlogonNotStarted:
  1033.    
  1034.          error_message = "The Netlogon service has not been started.";
  1035.          return;
  1036.  
  1037.       case NERR_CanNotGrowUASFile:
  1038.    
  1039.          error_message = "Unable to add to the user accounts database.";
  1040.          return;
  1041.  
  1042.       case NERR_TimeDiffAtDC:
  1043.    
  1044.          error_message = "This server's clock is not synchronized with the primary domain controller's clock.";
  1045.          return;
  1046.  
  1047.       case NERR_PasswordMismatch:
  1048.    
  1049.          error_message = "A password mismatch has been detected.";
  1050.          return;
  1051.  
  1052.       case NERR_NoSuchServer:
  1053.    
  1054.          error_message = "The server identification does not specify a valid server.";
  1055.          return;
  1056.  
  1057.       case NERR_NoSuchSession:
  1058.    
  1059.          error_message = "The session identification does not specify a valid session.";
  1060.          return;
  1061.  
  1062.       case NERR_NoSuchConnection:
  1063.    
  1064.          error_message = "The connection identification does not specify a valid connection.";
  1065.          return;
  1066.  
  1067.       case NERR_TooManyServers:
  1068.    
  1069.          error_message = "There is no space for another entry in the table of available servers.";
  1070.          return;
  1071.  
  1072.       case NERR_TooManySessions:
  1073.    
  1074.          error_message = "The server has reached the maximum number of sessions it supports.";
  1075.          return;
  1076.  
  1077.       case NERR_TooManyConnections:
  1078.    
  1079.          error_message = "The server has reached the maximum number of connections it supports.";
  1080.          return;
  1081.  
  1082.       case NERR_TooManyFiles:
  1083.    
  1084.          error_message = "The server cannot open more files because it has reached its maximum number.";
  1085.          return;
  1086.  
  1087.       case NERR_NoAlternateServers:
  1088.    
  1089.          error_message = "There are no alternate servers registered on this server.";
  1090.          return;
  1091.  
  1092.       case NERR_TryDownLevel:
  1093.    
  1094.          error_message = "Try down-level (remote admin protocol) version of API instead.";
  1095.          return;
  1096.  
  1097.       case NERR_UPSDriverNotStarted:
  1098.    
  1099.          error_message = "The UPS driver could not be accessed by the UPS service.";
  1100.          return;
  1101.  
  1102.       case NERR_UPSInvalidConfig:
  1103.    
  1104.          error_message = "The UPS service is not configured correctly.";
  1105.          return;
  1106.  
  1107.       case NERR_UPSInvalidCommPort:
  1108.    
  1109.          error_message = "The UPS service could not access the specified Comm Port.";
  1110.          return;
  1111.  
  1112.       case NERR_UPSSignalAsserted:
  1113.    
  1114.          error_message = "The UPS indicated a line fail or low battery situation. Service not started.";
  1115.          return;
  1116.  
  1117.       case NERR_UPSShutdownFailed:
  1118.    
  1119.          error_message = "The UPS service failed to perform a system shut down.";
  1120.          return;
  1121.  
  1122.       case NERR_BadDosRetCode:
  1123.    
  1124.          error_message = "The program below returned an MS-DOS error code:";
  1125.          return;
  1126.  
  1127.       case NERR_ProgNeedsExtraMem:
  1128.    
  1129.          error_message = "The program below needs more memory:";
  1130.          return;
  1131.  
  1132.       case NERR_BadDosFunction:
  1133.    
  1134.          error_message = "The program below called an unsupported MS-DOS function:";
  1135.          return;
  1136.  
  1137.       case NERR_RemoteBootFailed:
  1138.    
  1139.          error_message = "The workstation failed to boot.";
  1140.          return;
  1141.  
  1142.       case NERR_BadFileCheckSum:
  1143.    
  1144.          error_message = "The file below is corrupt.";
  1145.          return;
  1146.  
  1147.       case NERR_NoRplBootSystem:
  1148.    
  1149.          error_message = "No loader is specified in the boot-block definition file.";
  1150.          return;
  1151.  
  1152.       case NERR_RplLoadrNetBiosErr:
  1153.    
  1154.          error_message = "NetBIOS    returned an error: The NCB and SMB are dumped above.";
  1155.          return;
  1156.  
  1157.       case NERR_RplLoadrDiskErr:
  1158.    
  1159.          error_message = "A disk I/O error occurred.";
  1160.          return;
  1161.  
  1162.       case NERR_ImageParamErr:
  1163.    
  1164.          error_message = "Image parameter substitution failed.";
  1165.          return;
  1166.  
  1167.       case NERR_TooManyImageParams:
  1168.    
  1169.          error_message = "Too many image parameters cross disk sector boundaries.";
  1170.          return;
  1171.  
  1172.       case NERR_NonDosFloppyUsed:
  1173.    
  1174.          error_message = "The image was not generated from an MS-DOS diskette formatted with /S.";
  1175.          return;
  1176.  
  1177.       case NERR_RplBootRestart:
  1178.    
  1179.          error_message = "Remote boot will be restarted later.";
  1180.          return;
  1181.  
  1182.       case NERR_RplSrvrCallFailed:
  1183.    
  1184.          error_message = "The call to the Remoteboot server failed.";
  1185.          return;
  1186.  
  1187.       case NERR_CantConnectRplSrvr:
  1188.    
  1189.          error_message = "Cannot connect to the Remoteboot server.";
  1190.          return;
  1191.  
  1192.       case NERR_CantOpenImageFile:
  1193.    
  1194.          error_message = "Cannot open image file on the Remoteboot server.";
  1195.          return;
  1196.  
  1197.       case NERR_CallingRplSrvr:
  1198.    
  1199.          error_message = "Connecting to the Remoteboot server...";
  1200.          return;
  1201.  
  1202.       case NERR_StartingRplBoot:
  1203.    
  1204.          error_message = "Connecting to the Remoteboot server...";
  1205.          return;
  1206.  
  1207.       case NERR_RplBootServiceTerm:
  1208.    
  1209.          error_message = "Remote boot service was stopped; check the error log for the cause of the problem.";
  1210.          return;
  1211.  
  1212.       case NERR_RplBootStartFailed:
  1213.    
  1214.          error_message = "Remote boot startup failed; check the error log for the cause of the problem.";
  1215.          return;
  1216.  
  1217.       case NERR_RPL_CONNECTED:
  1218.    
  1219.          error_message = "A second connection to a Remoteboot resource is not allowed.";
  1220.          return;
  1221.  
  1222.       case NERR_BrowserConfiguredToNotRun:
  1223.    
  1224.          error_message = "The browser service was configured with MaintainServerList=No.";
  1225.          return;
  1226.  
  1227.       case NERR_RplNoAdaptersStarted:
  1228.    
  1229.          error_message = "Service failed to start since none of the network adapters started with this service.";
  1230.          return;
  1231.  
  1232.       case NERR_RplBadRegistry:
  1233.    
  1234.          error_message = "Service failed to start due to bad startup information in the registry.";
  1235.          return;
  1236.  
  1237.       case NERR_RplBadDatabase:
  1238.    
  1239.          error_message = "Service failed to start because its database is absent or corrupt.";
  1240.          return;
  1241.  
  1242.       case NERR_RplRplfilesShare:
  1243.    
  1244.          error_message = "Service failed to start because RPLFILES share is absent.";
  1245.          return;
  1246.  
  1247.       case NERR_RplNotRplServer:
  1248.    
  1249.          error_message = "Service failed to start because RPLUSER group is absent.";
  1250.          return;
  1251.  
  1252.       case NERR_RplCannotEnum:
  1253.    
  1254.          error_message = "Cannot enumerate service records.";
  1255.          return;
  1256.  
  1257.       case NERR_RplWkstaInfoCorrupted:
  1258.    
  1259.          error_message = "Workstation record information has been corrupted.";
  1260.          return;
  1261.  
  1262.       case NERR_RplWkstaNotFound:
  1263.    
  1264.          error_message = "Workstation record was not found.";
  1265.          return;
  1266.  
  1267.       case NERR_RplWkstaNameUnavailable:
  1268.    
  1269.          error_message = "Workstation name is in use by some other workstation.";
  1270.          return;
  1271.  
  1272.       case NERR_RplProfileInfoCorrupted:
  1273.    
  1274.          error_message = "Profile record information has been corrupted.";
  1275.          return;
  1276.  
  1277.       case NERR_RplProfileNotFound:
  1278.    
  1279.          error_message = "Profile record was not found.";
  1280.          return;
  1281.  
  1282.       case NERR_RplProfileNameUnavailable:
  1283.    
  1284.          error_message = "Profile name is in use by some other profile.";
  1285.          return;
  1286.  
  1287.       case NERR_RplProfileNotEmpty:
  1288.    
  1289.          error_message = "There are workstations using this profile.";
  1290.          return;
  1291.  
  1292.       case NERR_RplConfigInfoCorrupted:
  1293.    
  1294.          error_message = "Configuration record information has been corrupted.";
  1295.          return;
  1296.  
  1297.       case NERR_RplConfigNotFound:
  1298.    
  1299.          error_message = "Configuration record was not found.";
  1300.          return;
  1301.  
  1302.       case NERR_RplAdapterInfoCorrupted:
  1303.    
  1304.          error_message = "Adapter id record information has been corrupted.";
  1305.          return;
  1306.  
  1307.       case NERR_RplInternal:
  1308.    
  1309.          error_message = "An internal service error has occured.";
  1310.          return;
  1311.  
  1312.       case NERR_RplVendorInfoCorrupted:
  1313.    
  1314.          error_message = "Vendor id record information has been corrupted.";
  1315.          return;
  1316.  
  1317.       case NERR_RplBootInfoCorrupted:
  1318.    
  1319.          error_message = "Boot block record information has been corrupted.";
  1320.          return;
  1321.  
  1322.       case NERR_RplWkstaNeedsUserAcct:
  1323.    
  1324.          error_message = "The user account for this workstation record is missing.";
  1325.          return;
  1326.  
  1327.       case NERR_RplNeedsRPLUSERAcct:
  1328.    
  1329.          error_message = "The RPLUSER local group could not be found.";
  1330.          return;
  1331.  
  1332.       case NERR_RplBootNotFound:
  1333.    
  1334.          error_message = "Boot block record was not found.";
  1335.          return;
  1336.  
  1337.       case NERR_RplIncompatibleProfile:
  1338.    
  1339.          error_message = "Chosen profile is incompatible with this workstation.";
  1340.          return;
  1341.  
  1342.       case NERR_RplAdapterNameUnavailable:
  1343.    
  1344.          error_message = "Chosen network adapter id is in use by some other workstation.";
  1345.          return;
  1346.  
  1347.       case NERR_RplConfigNotEmpty:
  1348.    
  1349.          error_message = "There are profiles using this configuration.";
  1350.          return;
  1351.  
  1352.       case NERR_RplBootInUse:
  1353.    
  1354.          error_message = "There are workstations, profiles or configurations using this boot block.";
  1355.          return;
  1356.  
  1357.       case NERR_RplBackupDatabase:
  1358.    
  1359.          error_message = "Service failed to backup remoteboot database.";
  1360.          return;
  1361.  
  1362.       case NERR_RplAdapterNotFound:
  1363.    
  1364.          error_message = "Adapter record was not found.";
  1365.          return;
  1366.  
  1367.       case NERR_RplVendorNotFound:
  1368.    
  1369.          error_message = "Vendor record was not found.";
  1370.          return;
  1371.  
  1372.       case NERR_RplVendorNameUnavailable:
  1373.    
  1374.          error_message = "Vendor name is in use by some other vendor record.";
  1375.          return;
  1376.  
  1377.       case NERR_RplBootNameUnavailable:
  1378.    
  1379.          error_message = "(boot name, vendor id) is in use by some other boot block record.";
  1380.          return;
  1381.  
  1382.       case NERR_RplConfigNameUnavailable:
  1383.    
  1384.          error_message = "Configuration name is in use by some other configuration.";
  1385.          return;
  1386.  
  1387.       default:
  1388.  
  1389.          if ( error_code < NERR_BASE )
  1390.          {
  1391.             /*
  1392.             ** This ain't a LanMan error code, let's see if it'll Format...
  1393.             */
  1394.  
  1395.             LPVOID message_buffer = (LPVOID) NULL;
  1396.  
  1397.             FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
  1398.                            NULL,
  1399.                            error_code,
  1400.                            MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ),
  1401.                  (LPTSTR) &message_buffer,
  1402.                            0,
  1403.                            NULL );
  1404.  
  1405.             if ( message_buffer != NULL )
  1406.             {
  1407.                TCHAR temp_string[ 255 ];
  1408.  
  1409.                wsprintf( temp_string, "Not an NERR but it means %s", (LPCTSTR) message_buffer );
  1410.  
  1411.                ::LocalFree( message_buffer );
  1412.  
  1413.                error_message = temp_string;
  1414.             }
  1415.             else
  1416.             {
  1417.                TCHAR temp_string[ 256 ];
  1418.  
  1419.                wsprintf( temp_string, "Not an NERR, code is %d", error_code );
  1420.                error_message = temp_string;
  1421.             }
  1422.          }
  1423.          else
  1424.          {
  1425.             TCHAR temp_string[ 256 ];
  1426.  
  1427.             wsprintf( temp_string, "Unknown error %d (NERR_BASE+%d)", error_code, error_code - NERR_BASE );
  1428.             error_message = temp_string;
  1429.          }
  1430.  
  1431.          return;
  1432.    }
  1433. }
  1434.